<%@ taglib uri="struts-html" prefix="html" %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="struts-bean" prefix="bean" %>
<%@ taglib uri="cewolf" prefix='cewolf' %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!--Set the onLoad function here-->
<c:set var="onloadFunction" scope="session" value="document.realPayForm.priceTypeId.focus();"/>

<jsp:include page="../common/top.jsp"/>

<table width="100%">
	<tr>
		<td width="20%" valign="top">
			<table width="100%">
				<tr>
					<td class="sectionTitle">Statistics Views</td>
				</tr>
				<tr>
					<td class="menuUnderline">
						<html:link page="/struts/statistics/statisticsAction.do?methodToCall=getRegistrantsPerCountry">Guests by Country</html:link>
					</td>
				</tr>
				<tr>
					<td class="menuUnderline">
						<html:link page="/struts/statistics/statisticsAction.do?methodToCall=getGuestStatusStats">Guests' Status</html:link>
					</td>
				</tr>
				<tr>
					<td class="menuUnderline">
						<html:link page="/struts/statistics/statisticsAction.do?methodToCall=getGuestLengthOfStayStats">Guests' Length of Stay</html:link>
					</td>
				</tr>
				<tr>
					<td class="menuUnderline">
						<html:link page="/struts/statistics/statisticsAction.do?methodToCall=getGuestAgeStats">Guests' Ages</html:link>
					</td>
				</tr>
				<tr>
					<td class="menuUnderline">
						<html:link page="/struts/statistics/statisticsAction.do?methodToCall=getMoneyAmountPerCountry">Money per Country</html:link>
					</td>
				</tr>
			</table>
		</td>
		<!--Chart goes in here-->
		<td width="80%">
		 <c:choose>
			<c:when test="${requestScope.chartType=='countryPieChart'}">
				<cewolf:chart 
					id="pie" 
					title="Guests by Country"  
					type="pie3D" 
					showlegend="true">
					<cewolf:data>
						<cewolf:producer id="pieChartData"/>
					</cewolf:data>
				</cewolf:chart>
				<cewolf:img chartid="pie" renderer="/cewolf" width="800" height="400"/>
			</c:when>

			<c:when test="${requestScope.chartType=='guestStatusPieChart'}">
				<cewolf:chart 
					id="pie" 
					title="Guests' Status"  
					type="pie3D" 
					showlegend="true">
					<cewolf:data>
						<cewolf:producer id="pieChartData"/>
					</cewolf:data>
				</cewolf:chart>
				<cewolf:img chartid="pie" renderer="/cewolf" width="800" height="400"/>
			</c:when>

			<c:when test="${requestScope.chartType=='guestlengthOfStayBarChart'}">
				<cewolf:chart 
					id="bar3d" 
					title="Guests' Length of Stay"  
					type="verticalbar3d"
					xaxislabel="Days" 
					yaxislabel="Number of Guests" 
					showlegend="true">
					<cewolf:data>
						<cewolf:producer id="barChartData"/>
					</cewolf:data>
				</cewolf:chart>
				<cewolf:img chartid="bar3d" renderer="/cewolf" width="800" height="400"/>
			</c:when>

			<c:when test="${requestScope.chartType=='guestAgesBarChart'}">
				<cewolf:chart 
					id="bar3d" 
					title="Guests' Ages"  
					type="verticalbar3d"
					xaxislabel="Age" 
					yaxislabel="Number of Guests" 
					showlegend="true">
					<cewolf:data>
						<cewolf:producer id="barChartData"/>
					</cewolf:data>
				</cewolf:chart>
				<cewolf:img chartid="bar3d" renderer="/cewolf" width="800" height="400"/>
			</c:when>

			<c:when test="${requestScope.chartType=='moneyPerCountryPieChart'}">
				<cewolf:chart 
					id="pie3d" 
					title="Amount of Money per Country"  
					type="pie3D"
					showlegend="true">
					<cewolf:data>
						<cewolf:producer id="pieChartData"/>
					</cewolf:data>
				</cewolf:chart>
				<cewolf:img chartid="pie3d" renderer="/cewolf" width="800" height="400"/>
			</c:when>
		</c:choose>
		</td>
	</tr>

</table>
<jsp:include page="../common/bottom.jsp" />

	